package daoimpl

import (
	"log"
	"ustcLab/server/dao/bean"
)

// select
func GetRuleByName(ruleName string) (*bean.TRule, error) {
	rule := &bean.TRule{
		FName: ruleName,
	}
	res, err := GetInstance().Get(rule)
	if err != nil || !res {
		log.Fatalln("[GetRuleByName] err: ", err)
		return nil, err
	}
	log.Printf("[GetRuleByName] query monitorInfos success. ruleName:%s\n", rule.FName)
	return rule, nil
}
